home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_08
/
1008012b
< prev
next >
Wrap
Text File
|
1992-06-10
|
339b
|
19 lines
Listing 2 -- atexit.c
/* atexit function */
#include <stdlib.h>
/* external declarations */
extern void (*_Atfuns[])(void);
extern size_t _Atcount;
int (atexit)(void (*func)(void))
{ /* function to call at exit */
if (_Atcount == 0)
return (-1); /* list is full */
_Atfuns[--_Atcount] = func;
return (0);
}